<template>
  <div>
    <el-table v-loading="loading" :data="goodList">
      <el-table-column label="发放总额" align="center" prop="grantMoney" />
      <el-table-column label="发放人数" align="center" prop="grantNumber" />
      <el-table-column label="每人分得金额" align="center" prop="avgMoney" />
      <el-table-column label="发放周期" align="center" prop="grantPeriod">
        <template slot-scope='{row}'>
          {{ row.grantPeriod == 1 ? '每月' : '' }}
        </template>
      </el-table-column>
      <el-table-column label="奖励类型" align="center" prop="typeName" />
      <el-table-column label="创建时间" align="center" prop="createTime" width="100" />
    </el-table>

    <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
      @pagination="getList" />
    <!-- <div class="foot">
      <div style="margin-top: 30px;">
        <el-button type="primary" size="mini" @click="$emit('tableSelection', selectionList)">确认</el-button>
      </div>
    </div> -->

  </div>
</template>

<script>
import { shareOutBonusLevelRecord } from "@/api/system/dividend/manage.js"
import { forrmatterEnmu } from '@/utils/index'
export default {
  name: "Good",
  props: ['id'],
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 供应商商品表格数据
      goodList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
      },
      // 表单参数
      form: {},
      classifyList: [],
      selectionList: [],
    };
  },
  created() {
    this.getList();
  },
  methods: {
    forrmatterEnmu,
    /** 根据用户id查询用户分红记录 */
    getList() {
      this.loading = true;
      shareOutBonusLevelRecord().then(response => {
        this.goodList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
  }
};
</script>
<style lang="less" scoped>
.base-title {
  font-size: 18rpx;
  color: #1a1a1a;
  display: flex;
  align-items: center;
  margin-bottom: 15px;

  &::before {
    content: "";
    display: inline-block;
    width: 3px;
    height: 15px;
    background: #1777FF;
    border-radius: 3px;
    margin-right: 8px;
  }
}

// ::v-deep .pagination-container .el-pagination {
//   position: static;
// }

.foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
</style>